import { RMIObject } from "../../Engine/RMI/RMIObject";
import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { SeqIntHelper } from "../Public/SeqIntHelper";
import { Exception } from "../../Framework/Util/Exception";
//class AMI_IAchievement_getAchieveCodes

export class AMI_IAchievement_getAchieveCodes extends RMIObject {
  constructor(arg1?: Function, arg2?: Function, arg3?: any) {
    super();
    super(arg1, arg2);
    this.userObject = arg3;
    this.callFunction = "getAchieveCodes";
    return;
  }

  public /* override */ __response(__is: SerializeStream): void {
    var canReceivecodes: Array<any>;
    var recentCodes: Array<any>;

    try {
      canReceivecodes = SeqIntHelper.read(__is);
      recentCodes = SeqIntHelper.read(__is);
    } catch (__ex) {
      this.cdeException(
        new Exception(
          "ExceptionCodeSerialize",
          Exception.ExceptionCodeSerialize
        )
      );
      return;
    }
    this.cdeResponse(canReceivecodes, recentCodes);
    return;
  }

  public cdeResponse(arg1: Array<any>, arg2: Array<any>): void {
    if (this._response) {
      this._response.call(null, this, arg1, arg2);
    }
    return;
  }
}
